<template>
  <div class="banner">
    <swiper :options="swiperOption">
      <swiper-slide style="width: 100%;" v-for="banner in banners" :key="banner.id">
        <img :src="banner.image" style="width:100%; height:100%;display: block">
      </swiper-slide>
      <!-- <swiper-slide style="width: 100%;">
        <img src="./banner2.png" style="width:100%; height:100%;display: block">
      </swiper-slide>
      <swiper-slide style="width: 100%;">
        <img src="./banner3.png" style="width:100%; height:100%;display: block">
      </swiper-slide>
      <swiper-slide style="width: 100%;">
        <img src="./banner4.png" style="width:100%; height:100%;display: block">
      </swiper-slide>
      <swiper-slide style="width: 100%;">
        <img src="./banner5.png" style="width:100%; height:100%;display: block">
      </swiper-slide> -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
  name: 'banner',
  data () {
    return {
      swiperOption: {
        autoplay: true,
        initialSlide: 0,
        loop: true,
        pagination: {
          el: '.swiper-pagination'
        }
      }
    }
  },
  props: {
    banners: {
      type: Array
    }
  },
  components: {
    swiper,
    swiperSlide
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
$font-size-base:75;  //标注稿基准字体大小
$font-color-base:#333;  //基础字体颜色
// $bgColor:#f4f4f4;  //背景色
/*-------------font-size start-------------*/
@mixin font-dpr($font-size){
  font-size: $font-size;

  [data-dpr="2"] & {
    font-size: $font-size * 2;
  }

  [data-dpr="3"] & {
    font-size: $font-size * 3;
  }
}
.banner {
  // height: 420rem/$font-size-base
}
</style>
